package com.zhihui;

import com.zhihui.kafka.SendService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class ServiceMessageApplication {

	public static void main(String[] args) throws InterruptedException {
		ApplicationContext ac=SpringApplication.run(ServiceMessageApplication.class, args);
		SendService ss=ac.getBean(SendService.class);
		int i=0;
		while (true){
			i++;
			ss.sendMessage("message"+i+" was send");
			Thread.sleep(10000);
		}


	}
}
